﻿namespace PortableRiotGames.Interfaces.Summoner
{
    using Newtonsoft.Json;
    using PortableRiotGames.Infrastructure;
    using System.Collections.Generic;

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetRunesResponse : ResponseBase
    {
        /// <summary>
        /// List of rune pages associated with the summoner.
        /// </summary>
        [JsonProperty("pages")]
        public List<GetRunesResponseRunePage> Pages { get; set; }

        /// <summary>
        /// Summoner id associated with player.
        /// </summary>
        [JsonProperty("summonerId")]
        public long SummonerID { get; set; }
    }

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetRunesResponseRune
    {
        /// <summary>
        /// Rune description.
        /// </summary>
        [JsonProperty("description")]
        public string Description { get; set; }

        /// <summary>
        /// Rune ID.
        /// </summary>
        [JsonProperty("id")]
        public int ID { get; set; }

        /// <summary>
        /// Rune name.
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// Rune tier.
        /// </summary>
        [JsonProperty("tier")]
        public int Tier { get; set; }
    }

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetRunesResponseRunePage
    {
        /// <summary>
        /// Indicates if the rune page is the current rune page.
        /// </summary>
        [JsonProperty("current")]
        public bool Current { get; set; }

        /// <summary>
        /// Rune page ID.
        /// </summary>
        [JsonProperty("id")]
        public string ID { get; set; }

        /// <summary>
        /// Rune page name.
        /// </summary>
        [JsonProperty("name")]
        public string Name { get; set; }

        /// <summary>
        /// List of rune page slots associated with the rune page.
        /// </summary>
        [JsonProperty("slots")]
        public List<GetRunesResponseSlot> Slots { get; set; }
    }

    [JsonObject(MemberSerialization.OptIn)]
    public sealed class GetRunesResponseSlot
    {
        /// <summary>
        /// Rune associated with the rune slot.
        /// </summary>
        [JsonProperty("rune")]
        public GetRunesResponseRune Rune { get; set; }

        /// <summary>
        /// Rune slot ID. https://developer.riotgames.com/docs/game-constants.
        /// </summary>
        [JsonProperty("runeSlotId")]
        public int RuneSlotID { get; set; }
    }
}